package com.gitee.wsl.mathematics.function.active


/**
 * @author lidapeng
 * @description ReLu 函数
 * @date 8:56 上午 2020/1/11
 */
class ReLu : ActiveFunction {
    override fun function(x: Float): Float {
        return if (x > 0) {
            x
        } else {
            0f
        }
    }

    override fun functionG(out: Float): Float {
        return if (out > 0) {
            1f
        } else {
            0f
        }
    }
}
